home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 011 / brutil.arc / FILES.DOC < prev    next >
Encoding:
Text File  |  1988-06-02  |  7.3 KB  |  182 lines

  1. FILES is a fairly complete directory display utility.  It may be used to just
  2. list names of files or include specific information about them along with their
  3. names.    It is also capable of paging its output according to your requirements.
  4.  
  5. Syntax: FILES [drive:][path\][filename][.ext]/options]
  6.  
  7. drive -- optional drive
  8.     If omitted, the default drive is used.
  9.  
  10. path -- optional path
  11.     If omitted or if it does not begin with a backslash (\), the current
  12.     path is used.
  13.  
  14. filename -- optional filename
  15.     If omitted, * is used.
  16.  
  17. ext -- optional file extension
  18.     If omitted, * is used.    If the period (.) is entered and no extension
  19.     is supplied, a blank extension is used.
  20.  
  21. options -- optional options
  22.     If omitted, the program uses pre-configured options as described next.
  23.  
  24. Options:
  25.  
  26. This program may be set to run with a preset list of options or they may be
  27. toggled from the command line.    If for example, you enter /A on the command
  28. line, the A option is toggled.    If you enter /A/A it will be reset to its
  29. original condition.  If you preset the A option in the .COM file, entering /A
  30. turns it off.
  31.  
  32. /nn -- nn=1-255 set for paging every 1-255 lines
  33.        nn=0    set for no paging of output
  34. /A -- file's attributes (Arc Dir Vol Sys Hid R-O)
  35. /B -- bypass directory check for non-ambiguous file specification
  36. /C -- clear preset options (turn off /A /B /D /N /O /P /R /S /T and /X)
  37. /D -- file's creation date and time
  38. /F -- flip /A /D /P /R and /S options to their opposite condition.
  39. /N -- only "normal" (data) files
  40. /O -- only "other" (Dir and Vol) files
  41. /P -- include full path names for files
  42. /R -- file's rounded size in K bytes
  43. /S -- file's size in bytes
  44. /T -- include a total line
  45. /X -- include a total line and exclude detail lines
  46.  
  47. The program is distributed with all options off.  The same result can be
  48. achieved with a modified version of the program by typing:
  49.  
  50. FILES /0/C
  51.  
  52. Function:
  53.  
  54. FILES displays file names and whatever other information you want on the
  55. screen.  The DOS ERRORLEVEl flag is set to 1 if no files were found and to 2
  56. if some other error was found.    Otherwise, errorlevel is set to 0.
  57.  
  58. The /nn option stops the program every nn lines and waits for a response from
  59. the keyboard.  Pressing CTRL-C ends the program.
  60. Pressing the letter S or s lets you temporarily leave the program to do some
  61. other operations.  You are prompted to enter a command.  If you do, that
  62. command will be executed and FILES will regain control and proceed to the
  63. next file or group of files to be listed.  If you do not enter a command,
  64. the program will go to COMMAND.COM and you will then be able to enter any
  65. commands you wish.  When you finish, type EXIT and FILES will regain
  66. control and continue.
  67. When you are asked to enter a command, FILES makes available the fully
  68. specified path and file name of the last file displayed.  This allows you to
  69. use DOS's standard line editing facilities to include the file name.  The
  70. most common application would be to: Press Insert, type a command followed
  71. by a blank, Press F3 to bring down the filename, then press enter.  Here is an
  72. example.
  73.  
  74. FILES FILES/1
  75. FILES.ASM
  76. Enter command for shell operation.
  77. *FILES C:\MASM\SOURCE\FILES.ASM/F/P
  78. FILES.ASM    1988-02-18 16:09:30     12K     11264 Arc                    
  79. FILES.DOC
  80. Enter command for shell operation.
  81. *FILES C:\MASM\SOURCE\FILES.DOC/F/P
  82. FILES.DOC    1988-02-18 16:28:56      8K      6656 Arc                    
  83.  
  84. In the above example, I added another wrinkle! I typed /F/P after pressing
  85. F3.
  86.  
  87. As mentioned earlier, pressing ctrl-C causes the program to terminate.    If
  88. you use the /nn option with /T, the program will display a total line before
  89. it terminates.    This total line will include only the files listed up to the
  90. point you pressed the ctrl-C.  I first discovered this as a bug in the program
  91. and decided to leave it in.
  92.  
  93. Presetting options:
  94.  
  95. There are two ways to preset options:
  96. 1.  Modify the .ASM source file and re-assemble.
  97. 2.  Modify the .COM file directly using DEBUG or equivalent.
  98.  
  99. To modify the .ASM file, change the values of OPFLAG, LINECT, CURLIN, OPFLG2 and
  100. DIRFLAG.
  101. OPFLAG defines which of the /P /R /N /O /D /S /A or /F options are in effect.
  102. Use the XOR operator to separate the values if you use the equates provided for
  103. that purpose.
  104.  
  105. For example, if you want to display all information about files except the
  106. attributes:
  107.  
  108. OPFLAG    DB    FOPT XOR AOPT
  109.  
  110. LINECT defines whether or not paging is used.  A value other than 0 enables
  111. this feature.  The program will pause after that many lines have been displayed.
  112.  
  113. CURLIN defines the number of lines to print on only the first page.  Normally,
  114. this value should match LINECT but it does not need to.  You might wish to
  115. display 24 lines on the first page and 23 thereafter.  This would cause the
  116. program to print a full page for the first one and after that the line which
  117. had been on the bottom of the screen would be at the top of the next one on a
  118. 25 line screen.
  119.  
  120. For example, to set LINECT and CURLIN in this way enter:
  121.  
  122. LINECT    DB    23
  123. CURLIN    DB    24
  124.  
  125. OPFLG2 defines which of the /T or /X options are in effect.
  126. Usually, only one is used at a time because they both produce the total line
  127. at the end of the program.  If both are supplied, /X is used.  It supresses
  128. printing of individual lines describing each file.  The format of the total line
  129. is similar to the detail lines.  The number of files appears under the file
  130. names.    If the /P option is included, other totals are on the next line.
  131. If the /R or /S options are supplied, totals for rounded size and size in bytes
  132. are displayed under the proper column.    On disks with allocation block sizes
  133. less than 1K (1024 bytes) the file sizes are rounded to the next K boundary when
  134. /R is used.  In which case the total will probably be smaller than the sum of
  135. the sizes in K for the individual files.  The total is derived by rounding each
  136. file's size up to the next group boundary then rounding the final total up to
  137. the next K boundary.
  138.  
  139. DIRFLAG is toggled between 0 and 0FFH by the /B option.  Without this option,
  140. a check will be done to determine if the filename you entered is ambiguous --
  141. were there any asterisks (*) or question marks (?.
  142. If not, the file is checked to see if it is a directory file.  If so, the
  143. files in that directory will be listed.  If any of the conditions are not met,
  144. (/B option is selected, file name is ambiguous, or file is not a directory)
  145. just the information associated with that directory entry will be printed.
  146. A value of 0FFH selects the /B option.
  147.  
  148. To modify the .COM file, make the changes to locations 103H through 107H.
  149.  
  150. 0103 OPFLAG
  151. 0104 LINECT
  152. 0105 CURLIN
  153. 0106 OPFLG2
  154. 0107 DIRFLAG
  155.  
  156. You must manually calculate the value for OPFLAG using the following table:
  157.  
  158. Name Value
  159.  
  160. AOPT 001H
  161. DOPT 008H
  162. FOPT 0CbH
  163. NOPT 010H
  164. OOPT 020H
  165. POPT 080H
  166. ROPT 040H
  167. SOPT 002H
  168.  
  169. You must manually calculate the value for OPFLG2 using the following table:
  170.  
  171. Name Value
  172.  
  173. TOPT 001H
  174. XOPT 002H
  175.  
  176. Each option you select must be exclusive ored with the previous selections.
  177.  
  178. For example, as before, if you want to print all information about files
  179. except their attributes, AOPT (01H) XOR FOPT (0CBH) is 0CEH.  Store this value
  180. at location 0103H.
  181. l information about files
  182. except their attributes, AOPT (01H) XOR FOPT (0CBH)